package hw;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.Properties;

import javax.swing.JFrame;
import javax.swing.JLabel;


public class Launcher {
	private static final String[] syncPath = {"."};
	private static File dataFile;
	private static File cfgFile;
	private static Properties props = new Properties();
	private static BufferedReader cfgFileReader;
	public static void main(final String[] args) throws NumberFormatException, IOException {
		try {
			final String path = "C:\\eventos";
			dataFile = new File(new File(path),"eventos.sql");
			if (!dataFile.exists()) {
				dataFile.getParentFile().mkdirs();
				dataFile.createNewFile();
			}
			props.getProperty("neighbors");
			final P2PConnection p2pConnection = new P2PConnection(dataFile, 12384);
			p2pConnection.start();
			final File file = new File(new File(path),"archive.sql");
			file.createNewFile();
			final P2PConnection pp = new P2PConnection(file,12385);
			pp.start();
			final JFrame jFrame = new JFrame();
			jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			jFrame.add(new JLabel("running"));
			jFrame.pack();
			jFrame.setVisible(true);
		} catch (final Exception e) {
			e.printStackTrace();
		}

	}

}
